#include <iostream>
#include <string>
using namespace std;

int main() {
   //默认规定空格和换行是多个值之间的分割
    string s;
    getline(cin, s);

    int pos = s.rfind(" ");
    cout << s.size() - pos - 1 << endl;

    return 0;
}
